package helloworld.web.administrate;

import helloworld.entity.administrate.Function;
import helloworld.modules.struts2.CrudActionSupport;
import helloworld.service.administrate.FunctionService;

import java.util.List;

import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;

@Scope("prototype")
@Namespace("/administrate")
@Results({
	@Result(name = CrudActionSupport.RELOAD, location = "function.action", type = "redirect"), 
})
public class FunctionAction extends CrudActionSupport<Function> {

	private static final long serialVersionUID = -3817142225907229149L;
	
	private FunctionService functionService;

	private List<Function> functionList;
	
	public String menu(){
		functionList = functionService.getAllFunctions();
		return "menu";
	}
	
	@Override
	public String delete() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String input() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String list() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected void prepareModel() throws Exception {
		// TODO Auto-generated method stub

	}

	@Override
	public String save() throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	public Function getModel() {
		// TODO Auto-generated method stub
		return null;
	}

	@Autowired
	public void setFunctionService(FunctionService functionService) {
		this.functionService = functionService;
	}

	public List<Function> getFunctionList() {
		return functionList;
	}

	public void setFunctionList(List<Function> functionList) {
		this.functionList = functionList;
	}
	

}
